package com.logos;

import com.logos.config.SpringConfig;
import com.logos.dao.BookDao;
import com.logos.dao.impl.BookDaoImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AppForAnnotationBeanLifeCycle {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        BookDao bookDao1 = (BookDao) ctx.getBean("bookDao");
        BookDao bookDao2 = (BookDao) ctx.getBean("bookDao");
        System.out.println("bookDao1 = " + bookDao1);
        System.out.println("bookDao2 = " + bookDao2);
        ctx.close();
    }
}
